/*
 * String.h
 *
 *  Created on: 2011-5-24
 *      Author: william nie
 */

#include<stdio.h>
#include<stdlib.h>
#include"datadef.h"

#ifndef STRING_H_
#define STRING_H_

#define MAX_STR_LEN 155
#define STR_INCREMENT 20

typedef char SString[MAX_STR_LEN + 1];

Status SStrAssign(SString *sString , char *chars);

Status SStrCopy(SString *sStringA , SString sStringB);

BOOL SStrEmpty(SString sString);

Status SStrExpand(SString sString);

int SStrCompare(SString sStringA , SString sStringB);

int SStrLength(SString sString);

Status ClearSString(SString *sString);

Status ContactSStr(SString *sString , SString sStringA , SString sStringB);

Status SubSString(SString mainString , int pos , int len , SString *subString);

int SStrIndex(SString mainString , SString subToFind , int pos);

Status SStrReplace(SString *mainString , SString sStrToRep , SString sStr);

Status SStrInsert(SString *mainString , int pos , SString sString);

Status SStrDelete(SString *mainString , int pos , int len);

Status DestroySString(SString *sString);

Status PrintSString(SString sString);

#endif /* STRING_H_ */
